package com.heima.article.controller.v1;

import com.heima.article.service.ApArticleService;
import com.heima.feign.article.IArticleClient;
import com.heima.model.article.dtos.ArticleDto;
import com.heima.model.common.dtos.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: JW
 * @Description: TODO
 * @DateTime: 2022-02-13 20:20
 **/
@RestController
@RequestMapping("/api/v1/article")
public class ArticleClient implements IArticleClient {

    @Autowired
    private ApArticleService apArticleService;

    /**
     * @param articleDto
     * @Author: JW
     * @Description: TODO 保存文章 && 修改
     * @Date: 20:19 2022-02-13
     * @Param: [articleDto]
     * @return: com.heima.model.common.dtos.ResponseResult
     */
    @Override
    @PostMapping("/save")
    public ResponseResult saveArticle(ArticleDto articleDto) {

        return apArticleService.saveArticle(articleDto);
    }
}
